<template>
  <div class="app-container">
    <el-form :model="imgList" ref="queryRef" :inline="true" label-width="140px">
      <el-row :gutter="20" v-for="item in imgList" :key="item.configId">
        <el-col  :xs="24" :sm="24" :lg="24">
          <el-form-item :label="item.configName">
            <imageUpload :limit="9" :isShowTip="false" v-model="item.configValue"></imageUpload>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row :gutter="20" style="margin-top: 40px;display: flex;justify-content: center;">
        <el-button type="primary" size="large" @click="submitForm">保存</el-button>
    </el-row>
  </div>
</template>

<script setup name="Poster">
import { posterInfo, uploadImg } from "@/api/operate/poster";
import imageUpload from "@/components/ImageUpload";


const { proxy } = getCurrentInstance();
const imgList = ref([]);


/** 查询海报配置页面数据 */
function getList() {
    posterInfo({configGroup:'poster'}).then(response => {
        imgList.value = response.rows
    });
}

/** 提交按钮 */
function submitForm() {
    uploadImg(imgList.value).then(response => {
        proxy.$modal.msgSuccess("保存成功");
    })
}


getList();
</script>
